package com.zhuoyue.biz.core.command.cmd.common.faa.base;


import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
/**
 * @author Administrator
 */
@Component
public class MultiFunctionSwitch0Faa8A09Utils {
    private static final String DELETE = "delete";
    private static final String CUSTOMIZE = "customize";

    public static String index(String startSwitchState, String mode, String way) {
        String startSwitchState1 = startSwitchState;
        String childIndex = "";
        if (!(CUSTOMIZE.equals(mode)) && !DELETE.equals(mode)) {
            startSwitchState1 = "OTHER";
        }
        if (StringUtils.isEmpty(startSwitchState)) {
            startSwitchState1 = "OTHER";
        }
        switch (startSwitchState1) {
            case "OTHER":
            case "OPEN":
                switch (way) {
                    case "1":
                        childIndex = "01";
                        break;
                    case "2":
                        childIndex = "03";
                        break;
                    case "3":
                        childIndex = "05";
                        break;
                    case "4":
                        childIndex = "07";
                        break;
                    default:
                        break;
                }
                break;
            case "CLOSE":
                switch (way) {
                    case "1":
                        childIndex = "02";
                        break;
                    case "2":
                        childIndex = "04";
                        break;
                    case "3":
                        childIndex = "06";
                        break;
                    case "4":
                        childIndex = "08";
                        break;
                    default:
                        break;
                }
                break;
            default:

                break;
        }

        return childIndex;
    }
}
